'use strict';

/**
 * @ngdoc function
 * @name webApp.controller:UsercommunicateCtrl
 * @description
 * # UsercommunicateCtrl
 * Controller of the webApp
 */

angular.module('webApp')
  .controller('userCommunicate', function ($scope,promiseUserCommunicate,cookie) {
    $scope.$on('$stateChangeSuccess',function(){
      if(cookie.getCookie('access_token')){
        promiseUserCommunicate.usercomments(1,10).then(function(data){
          $scope.comment = data;
        });
      }
    });
});
